﻿using System;
using System.Text;

namespace Agile.DataAccess
{
    /// <summary>
    /// 
    /// </summary>
	public class DbCommandData
	{
        /// <summary>
        /// 
        /// </summary>
        public bool Output { get;  set; }

        /// <summary>
        /// 
        /// </summary>
        internal DbContext Context { get; private set; }

        /// <summary>
        /// 
        /// </summary>
		public System.Data.IDbCommand InnerCommand { get; private set; }
        /// <summary>
        /// 
        /// </summary>
		public bool UseMultipleResultsets { get; set; }
        /// <summary>
        /// 
        /// </summary>
		public IDataReader Reader { get; set; }
        /// <summary>
        /// 
        /// </summary>
		internal ExecuteQueryHandler ExecuteQueryHandler;
        /// <summary>
        /// 
        /// </summary>
		public StringBuilder Sql { get; private set; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        /// <param name="innerCommand"></param>
        internal DbCommandData(DbContext context, System.Data.IDbCommand innerCommand)
		{
			Context = context;
			InnerCommand = innerCommand;
			InnerCommand.CommandType = (System.Data.CommandType)DbCommandTypes.Text;
			Sql = new StringBuilder();
		}
	}
}
